function updateClock() {
  var clock1 = document.getElementById("time1");
  var clock21 = document.getElementById("time21");
  var clock22 = document.getElementById("time22");
  function getZero(date) {
    date >= 10 || (date = "0" + date);
    return date;
  }
  var now = new Date();

  var year = getZero(now.getFullYear());
  var month = getZero(now.getMonth() + 1);
  var day = getZero(now.getDate());
  var hours = getZero(now.getHours());
  var minutes = getZero(now.getMinutes());
  // var seconds = getZero(now.getSeconds());
  var dayOfWeekIndex = now.getDay();

  var days = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];

  var time =
    hours.toString().padStart(2, "0") +
    ":" +
    minutes.toString().padStart(2, "0");
  var time1 = year + "年" + month + "月" + day + "日";
  var dayOfWeek = days[dayOfWeekIndex];

  clock1.textContent = time;
  clock21.textContent = dayOfWeek;
  clock22.textContent = time1;
}

function toPlatform() {
  window.location.href = "https://mjglpt.whut.edu.cn/";
}
updateClock();

setInterval(() => {
  updateClock();
}, 1000*10)
